package com.geaosu.wanandroid.kotlin.activity

import android.content.Intent
import android.os.Bundle
import android.os.CountDownTimer
import androidx.appcompat.app.AppCompatActivity
import com.geaosu.wanandroid.kotlin.BuildConfig
import com.geaosu.wanandroid.kotlin.R

/**
 * 启动页面
 */
class SplashActivity : AppCompatActivity() {

    var mTimer: CountDownTimer = object : CountDownTimer(2000, 1000) {
        override fun onTick(millisUntilFinished: Long) {
            //TODO("Not yet implemented")
        }

        override fun onFinish() {
            //TODO("Not yet implemented")
            // startActivity(object : Intent(applicationContext, MainActivity.class))
            startActivity(Intent(this@SplashActivity, MainActivity::class.java))
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)

        // 获取app版本号:
        // String v = BuildConfig.VERSION_NAME

        mTimer.start()
    }
}